<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        @if(count($errors) > 0)
            @foreach($errors->all() as $error)
                <div class="alert alert-danger">{{ $error }}</div>
            @endforeach
        @endif
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>营销短信 <small>&nbsp;&nbsp;  短信剩余</small><span class="text-danger">{{ 1 }}条</span> </h5>
                </div>
                <div class="ibox-content">
                    <form method="post" action="/ceb/channels/store" class="form-horizontal">
                        {{csrf_field()}}

                        <div class="form-group">
                            <label class="col-sm-2 control-label">短信内容：</label>
                            <div class="col-sm-6">
                                <div class="row">
                                    <div class="col-md-8">
                                        <span class="help-block m-b-none text-danger">（*内容长度不大于350个汉字,内容必须带有尊称和"回复TD退订"信息!）</span>
                                        <textarea name="sms-content" class="form-control"
                                                  placeholder="短信内容" rows="5"></textarea>
                                        <span id="text-count" class="help-block m-b-none"></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >渠道：</label>
                            <div class="col-sm-10">
                                <div class="row">
                                    <div class="col-sm-10">
                                        <fieldset>
                                            <legend >
                                                <small>
                                                    <label class="checkbox-inline i-checks">
                                                        <input class="check-all"
                                                               type="checkbox" data-value=""
                                                        >
                                                       全选
                                                    </label>
                                                </small>
                                            </legend>
                                          {{--  @foreach($permission['childs'] as $child)
                                                <label class="checkbox-inline i-checks">
                                                    <input class="check-all-child" type="checkbox" name="permissions[]" value="{{$child['id']}}"

                                                    >{{$child['label']}}</label>
                                            @endforeach--}}
                                        </fieldset>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">注册时间：</label>
                            <div class="col-sm-10">
                                <input readonly placeholder="开始日期" class="form-control layer-date" id="start">
                                ~~
                                <input readonly placeholder="结束日期" class="form-control layer-date" id="end">
                            </div>
                        </div>

                        <div class="form-group ">
                            <label class="col-sm-2 control-label">实名：</label>
                            <div class="col-sm-2">
                                <select class="form-control m-b" name="info[source]">
                                    @foreach($realnamed as $key => $val)
                                     <option value="{{ $val['id'] }}">{{ $val['name'] }}</option>
                                    @endforeach
                                </select>
                                <span class="help-block m-b-none">{{$errors->first('info.source')}}</span>
                            </div>
                            <label class="col-sm-2 control-label">首投：</label>
                            <div class="col-sm-2">
                                <select class="form-control m-b" name="info[source]">
                                    @foreach( $isinvested as $key => $val)
                                    <option value="{{ $val['id'] }}">{{ $val['name'] }}</option>
                                    @endforeach
                                </select>
                                <span class="help-block m-b-none">{{$errors->first('info.source')}}</span>
                            </div>
                            <label class="col-sm-2 control-label">性别：</label>
                            <div class="col-sm-2">
                                <select class="form-control m-b" name="info[source]">
                                    @foreach($sexs as $key=>$val)
                                    <option value="{{ $val['id'] }}">{{ $val['name'] }}</option>
                                    @endforeach
                                </select>
                                <span class="help-block m-b-none">{{$errors->first('info.source')}}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">年龄&nbsp;&nbsp;&gt;=</label>
                            <div class="col-sm-4">
                                <div class="row">
                                    <div class="col-md-4">
                                        <input type="text" name="code" value=""
                                               placeholder="年龄" class="form-control">
                                        <span class="help-block m-b-none"></span>
                                    </div>
                                </div>
                            </div>
                            <label class="col-sm-2 control-label">投资金额 &nbsp;&nbsp;&gt;=</label>
                            <div class="col-sm-4">
                                <div class="row">
                                    <div class="col-md-6">
                                        <input type="text" name="no" value=""
                                               placeholder="投资金额" class="form-control">
                                        <span class="help-block m-b-none"></span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label" >等级：</label>
                            <div class="col-sm-10">
                                <div class="row">
                                    <div class="col-sm-10">
                                        <fieldset>
                                            <legend >
                                                <small>
                                                    <label class="checkbox-inline i-checks">
                                                        <input class="check-all"
                                                               type="checkbox" data-value=""
                                                        >
                                                        全选
                                                    </label>
                                                </small>
                                            </legend>
                                            {{--  @foreach($permission['childs'] as $child)
                                                  <label class="checkbox-inline i-checks">
                                                      <input class="check-all-child" type="checkbox" name="permissions[]" value="{{$child['id']}}"

                                                      >{{$child['label']}}</label>
                                              @endforeach--}}
                                        </fieldset>
                                    </div>
                                </div>
                            </div>
                        </div>


                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">提 交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>

<!-- 自定义js -->
<script src="/js/content.js?v=1.0.0"></script>

<!-- iCheck -->
<script src="/js/plugins/iCheck/icheck.min.js"></script>
<script src="/js/plugins/layer/laydate/laydate.js"></script>
<script>
    $(document).ready(function () {

        //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY-MM-DD',
          //  min: laydate.now(), //设定最小日期为当前日期
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY-MM-DD',
            min: laydate.now(),
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);


        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });

        $("textarea[name='sms-content']").keydown(function () {
            countTextNum()
        });
        $("textarea[name='sms-content']").keyup(function () {
            countTextNum()
        });
        function countTextNum() {
            var counts = $("textarea[name='sms-content']").val().length;
            $('#text-count').html("已经输入"+counts +"字");
        }

    });
</script>


</body>

</html>
